package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * 采购明细实体类
 */
@ApiModel(value = "采购明细实体类",description = "封装采购订单中各商品的价格数量等信息")
@TableName("t_buyDetail")
public class BuyDetailBean {
    /**编号**/
    @ApiModelProperty("编号")
    @TableId(value = "pk_bDetailId",type = IdType.AUTO)
    private Integer id;
    /**采购订单编号**/
    @ApiModelProperty("采购订单编号")
    @TableField("fk_buyId")
    private Integer buyId;
    /**商品编号**/
    @ApiModelProperty("商品编号")
    @TableField("fk_productId")
    private String productId;
    /**商品对象**/
    @ApiModelProperty(hidden = true)
    @TableField(exist = false)
    private ProductBean product;
    /**采购价**/
    @ApiModelProperty("采购价")
    @TableField("bd_price")
    private Integer price;
    /**采购数量**/
    @ApiModelProperty("采购数量")
    @TableField("bd_num")
    private Integer num;

    public BuyDetailBean() {
    }

    public BuyDetailBean(Integer buyId, String productId, Integer price, Integer num) {
        this.buyId = buyId;
        this.productId = productId;
        this.price = price;
        this.num = num;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getBuyId() {
        return buyId;
    }

    public void setBuyId(Integer buyId) {
        this.buyId = buyId;
    }

    public String getProductId() {
        return productId;
    }

    public void setProductId(String productId) {
        this.productId = productId;
    }

    public ProductBean getProduct() {
        return product;
    }

    public void setProduct(ProductBean product) {
        this.product = product;
    }

    public Integer getPrice() {
        return price;
    }

    public void setPrice(Integer price) {
        this.price = price;
    }

    public Integer getNum() {
        return num;
    }

    public void setNum(Integer num) {
        this.num = num;
    }

    @Override
    public String toString() {
        return "BuyDetailBean{" +
                "id=" + id +
                ", buyId=" + buyId +
                ", productId=" + productId +
                ", product=" + product +
                ", price=" + price +
                ", num=" + num +
                "}\n";
    }
}
